package com.ruoyi.problem.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.problem.mapper.ProblemAnswerMapper;
import com.ruoyi.problem.domain.ProblemAnswer;
import com.ruoyi.problem.service.IProblemAnswerService;

/**
 * 卡牌问题解答Service业务层处理
 * 
 * @author DEREK
 * @date 2023-08-03
 */
@Service
public class ProblemAnswerServiceImpl extends ServiceImpl<ProblemAnswerMapper, ProblemAnswer> implements IProblemAnswerService 
{
    @Autowired
    private ProblemAnswerMapper problemAnswerMapper;

    /**
     * 查询卡牌问题解答
     * 
     * @param id 卡牌问题解答主键
     * @return 卡牌问题解答
     */
    @Override
    public ProblemAnswer selectProblemAnswerById(Long id)
    {
        return problemAnswerMapper.selectProblemAnswerById(id);
    }

    /**
     * 查询卡牌问题解答列表
     * 
     * @param problemAnswer 卡牌问题解答
     * @return 卡牌问题解答
     */
    @Override
    public List<ProblemAnswer> selectProblemAnswerList(ProblemAnswer problemAnswer)
    {
        return problemAnswerMapper.selectProblemAnswerList(problemAnswer);
    }

    /**
     * 新增卡牌问题解答
     * 
     * @param problemAnswer 卡牌问题解答
     * @return 结果
     */
    @Override
    public int insertProblemAnswer(ProblemAnswer problemAnswer)
    {
        problemAnswer.setCreateTime(DateUtils.getNowDate());
        return problemAnswerMapper.insertProblemAnswer(problemAnswer);
    }

    /**
     * 修改卡牌问题解答
     * 
     * @param problemAnswer 卡牌问题解答
     * @return 结果
     */
    @Override
    public int updateProblemAnswer(ProblemAnswer problemAnswer)
    {
        return problemAnswerMapper.updateProblemAnswer(problemAnswer);
    }

    /**
     * 批量删除卡牌问题解答
     * 
     * @param ids 需要删除的卡牌问题解答主键
     * @return 结果
     */
    @Override
    public int deleteProblemAnswerByIds(Long[] ids)
    {
        return problemAnswerMapper.deleteProblemAnswerByIds(ids);
    }

    /**
     * 删除卡牌问题解答信息
     * 
     * @param id 卡牌问题解答主键
     * @return 结果
     */
    @Override
    public int deleteProblemAnswerById(Long id)
    {
        return problemAnswerMapper.deleteProblemAnswerById(id);
    }
}
